import Quill from 'quill';

const Inline = Quill.import('blots/inline');

class TagBlot extends Inline {
  static blotName = 'tag';
  static tagName = 'span';
  static className = 'tag-container';

  static create(value): any {
    const node = super.create(value);
    node.setAttribute('contenteditable', 'false');
    node.setAttribute('style', `background:${value.background};color:${value.color};`);

    node.addEventListener('click', (event) => {
      console.log('click~~');
    });
    return node;
  }
}

export default TagBlot;
